/**
 * Created by user on 2018/11/22.
 */
import React from 'react'
import classnames from 'classnames'
import PropTypes from 'prop-types'
import styles from './page.less'
import Loader from '@/components/Loader'

const Page = ({ loading, className, children }) => {
  return (
    <div
      className={classnames(className, loading ? styles.loading: '')}
    >
      {loading ? <Loader spinning /> : children}
    </div>
  )
}
Loader.propTypes = {
  loading: PropTypes.bool,
  className: PropTypes.bool,
  children: PropTypes.node
}

export default Page
